home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Dev / gcc263-base.lha / gnu / rexx / gcc.rexx next >
OS/2 REXX Batch file  |  1993-11-01  |  2KB  |  47 lines

  1. /*rx
  2.  *  gcc.rexx --- ARexx shell to setup needed stack for GCC.
  3.  *  By Loren J. Rittle (l-rittle@uiuc.edu)   Sat Feb 29 21:05:54 1992
  4.  *  Updated to work with any AmigaOS shell - Wed Mar  4 00:11:16 1992
  5.  *
  6.  *  In order to keep this file in usr:bin (instead of REXX: or S:)
  7.  *  you must:
  8.  *    ; If this file is not in usr:bin, then preform this step.
  9.  *    copy <this_file> usr:bin/gcc.rexx
  10.  *
  11.  *    ; It is important to rename gcc so it is not called by accident
  12.  *    ; if this wrapper is not invoked before gcc (If you don't rename
  13.  *    ; gcc, this could be the case if the alias is not expanded).
  14.  *    rename usr:bin/gcc usr:bin/gcc-driver
  15.  *
  16.  *    ; Preform this step if your shell needs the script bit set
  17.  *    ; in order to recognize ARexx programs.
  18.  *    protect usr:bin/gcc.rexx +s
  19.  *
  20.  *    ; put the next line in your shell startup file.
  21.  *    alias gcc usr:bin/gcc.rexx
  22.  */
  23.  
  24. /* You may want to set gcc_stack_size larger or smaller.
  25.    Markus uses 250000, I use 300000.  I would not go below 250000. */
  26. gcc_stack_size = 300000
  27.  
  28. /* NO GENERAL USER MODIFIABLE PARTS BELOW THIS COMMENT. */
  29.  
  30. if address() == 'REXX' then /* running from dumb (wrt ARexx) shell, better */
  31.   address 'COMMAND'         /* redirect where command get issued to */
  32.  
  33. if address() == 'COMMAND' then
  34.   normal_stack_size = pragma('s', gcc_stack_size)
  35. else
  36.   do
  37.     normal_stack_size = pragma('s', 4000)
  38.     'stack' gcc_stack_size
  39.   end
  40.  
  41. 'usr:bin/gcc-driver' arg(1)
  42.  
  43. if address() == 'COMMAND' then
  44.   call pragma('s', normal_stack_size)
  45. else
  46.   'stack' normal_stack_size
  47.